package com.swx.identityservice.service.impl;


import com.swx.identityservice.mapper.ScbpDeptMapper;
import com.swx.identityservice.models.ScbpDept;
import com.swx.identityservice.models.ScbpDeptTree;
import com.swx.identityservice.service.ScbpDeptService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScbpDeptServiceImpl extends CrudServiceImpl<ScbpDept> implements ScbpDeptService {

    private static final Logger logger = LoggerFactory.getLogger(ScbpDeptServiceImpl.class);

    @Autowired
    private ScbpDeptMapper scbpDeptMapper;

    @Override
    public List<ScbpDeptTree> getDeptsAsTree(Object key) throws Exception {
        return scbpDeptMapper.getDeptsAsTree(key);
    }

    @Override
    public List<ScbpDeptTree> getDeptsAndRolesAsTree(Object key) throws Exception {
        return scbpDeptMapper.getDeptsAndRolesAsTree(key);
    }

    @Override
    public List<ScbpDept> selectDeptsByPid(Integer id) {
        return scbpDeptMapper.selectDeptsByPid(id);
    }

    @Override
    public List<ScbpDept> getRolesByDeptIds(Integer[] id) {
        return scbpDeptMapper.getRolesByDeptIds(id);
    }

    @Override
    public List<ScbpDept> selectDeptsList() {
        return scbpDeptMapper.selectDeptsList();
    }

    @Override
    public List<ScbpDept> selectUnit() {
        return scbpDeptMapper.selectUnit();
    }


    @Override
    public ScbpDept selectDeptById(Integer id) {
        return scbpDeptMapper.selectDeptById(id);
    }

    @Override
    public ScbpDept selectDeptByName(String Name) {
        return scbpDeptMapper.selectDeptByName(Name);
    }


}
